/**
 * 
 */
package com.fang.www.join.two.three;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

/**
 * @author 王刚
 *
 */
public class GroupComparator extends WritableComparator {
	public GroupComparator(UserKey userKey,boolean createInstance){
		super(UserKey.class,true);
		System.out.println("================================================");
	}
	public GroupComparator(){
		super(UserKey.class,true);
		System.out.println("1111111111111111111111111111111111111111111111111111111");
	}
	@Override
	public int compare(WritableComparable a, WritableComparable b) {
		// TODO Auto-generated method stub
		UserKey a1 = (UserKey)a;
		UserKey b1 = (UserKey)b;
		if(a1.getKeyid()==b1.getKeyid()){
			return 0;
		}else{
			return a1.getKeyid()>b1.getKeyid()?1:-1;
		}
	}
	
}
